Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: subpath bad matching #202

Merged
merged 7 commits into from
Aug 17, 2023

Conversation

Mocramis
Copy link
Contributor

Although uncommon, i saw nothing in the dbus spec forbidding sub-path matching possible parent paths.

Current implementation of Introspect assumes this is the case though resulting in path being presented where they are not for instance instrospect on /a returning subnodes b and d when the registered paths are /a/b and /c/a/d

This mr tests and fixes the issue.

Note: a more efficient way to fix would have been to use str.removeprefix but it is only available from python3.9.

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.07% ⚠️

Comparison is base (4051cf2) 82.66% compared to head (2ce068d) 82.59%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #202      +/-   ##
==========================================
- Coverage   82.66%   82.59%   -0.07%     
==========================================
  Files          27       27              
  Lines        3242     3241       -1     
  Branches      671      672       +1     
==========================================
- Hits         2680     2677       -3     
- Misses        344      345       +1     
- Partials      218      219       +1     
Files Changed Coverage Δ
src/dbus_fast/__version__.py 0.00% <0.00%> (ø)
src/dbus_fast/message_bus.py 71.88% <100.00%> (-0.41%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Any base path matched by a subpath with a different root will also return the nodes
of the subpath (which is obviously erroneous)
@Mocramis
Copy link
Contributor Author

Hmm i'm not sure what Codecov means by "Consider uploading the report"

@bdraco bdraco requested a review from mdegat01 May 15, 2023 14:22
@bdraco
Copy link
Member

bdraco commented May 15, 2023

I think this change is fine. I would like Mike to take a look at it though since it has potential impact to supervisor

@Mocramis
Copy link
Contributor Author

I think this change is fine. I would like Mike to take a look at it though since it has potential impact to supervisor

Any news ?

@bdraco
Copy link
Member

bdraco commented May 26, 2023

I chatted with Mike about this earlier this week. He hasn't had time to test it yet

@Mocramis
Copy link
Contributor Author

any updates ?

@bdraco bdraco changed the title Subpath bad matching fix: subpath bad matching Aug 17, 2023
@bdraco
Copy link
Member

bdraco commented Aug 17, 2023

This LGTM. I can't see this causing a problem.

@bdraco bdraco merged commit 5d6f90b into Bluetooth-Devices:main Aug 17, 2023
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants